package com.tuyrt.`as`.proj.main.route

import android.content.Context
import com.alibaba.android.arouter.facade.Postcard
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.facade.service.DegradeService
import com.alibaba.android.arouter.launcher.ARouter

/**
 * author: Administrator on 2021/6/8.
 * desc: 全局降级服务，当路由的时候，目标不存在，此时重定向到统一页面
 */
@Route(path = "/degrade/global/service")
class DegradeServiceImpl : DegradeService {
    override fun init(context: Context?) {

    }

    override fun onLost(context: Context?, postcard: Postcard?) {
        ARouter.getInstance().build("/degrade/global/activity")
            .greenChannel() // 重定向到错误页，不会被拦截器拦截
            .navigation()
    }
}